﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace RunUI.Attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public class ForeignRelationAttribute : Attribute
    {
        public Type Table { get; set; }
        public string ValueColumn { get; set; }
        /// <summary>
        /// 列表、详情页面中，显示的列
        /// </summary>
        public string[] ShowColumns { get; set; }
        /// <summary>
        ///  显示的列，用此分隔符链接
        /// </summary>
        public string Separator { get; set; } = "-";
        /// <summary>
        /// 如果达不到想要的效果，使用这个参数自定义返回属性
        /// <para>此参数会被传入 IForeignRelationProvider.GetForeignRelationsWithExpressionAsync的第一个参数中</para>
        /// </summary>
        public string Expression { get; set; }
    }
}
